import 'package:flutter/material.dart';
import 'package:myapp/components/Logger/loggers.dart';
import 'package:myapp/components/Msg/msg_item.dart';

class MsgPage extends StatefulWidget {
  const MsgPage({super.key});

  @override
  State<MsgPage> createState() => _MsgPageState();
}

class _MsgPageState extends State<MsgPage> {
  @override
  Widget build(BuildContext context) {
    // return const Text('消息');
    return Column(
      children: [
        GestureDetector(
          child: const MsgItem(),
          onTap: () => printInfo(context),
        ),
        const MsgItem(),
        const MsgItem(),
        const MsgItem(),
        const MsgItem(),
        const MsgItem(),
      ],
    );
  }
}

void printInfo(context) {
  logger.t('我是一个自定义方法  无返回值');
  Navigator.of(context).pushNamed("/chat");
  // Navigator.of(context).push(new MaterialPageRoute(
  //   builder: (context) {
  //     return new Chat();
  //   },
  // ));
}
